1. Field of the Invention
The invention relates to image processing method and apparatus for cutting out a desired area by performing an orthogonal transforming process to an image and to a storage medium which is used in those image processing method and apparatus.
2. Related Background Art
Hitherto, in a device such as copying machine, OCR (Optical Character Reader), or the like, a method of converting an image into data on a space frequency base and separating a photograph image area, a dotted image area, or a character image area has been proposed.
(1) In the Record 93-01-02 of the society for research of The Institute of Image Electrical Engineers of Japan, a method of separating an image area by paying attention to a difference between a character image and a dotted image (hereinafter, this method is referred to as a first prior art) has been disclosed. According to this method, first, image data is divided into small blocks of a size of (8.times.8) and a DCT (Discrete Cosine Transform) process is executed. The DCT is widely used in an image encoding system such as a JPEG (Joint Photographic Experts Group) standard or the like and converts image data to data on a frequency base. Thus, as for a coefficient of each block, one row and one column indicate a DC component of the block, a column direction shows a frequency in the horizontal direction, and a row direction indicates a frequency in the vertical direction. In each of the directions, a higher frequency is shown with an increase in number of the row (column).
Subsequent to the DCT, a zigzag scanning process is executed and 2-dimensional block data is converted to 1-dimensional block data. The zigzag scanning process is also a processing method which is used in the JPEG standard or the like. As shown in FIG. 11, a scan is performed in the oblique direction from a low frequency portion to a high frequency portion. As a next step, a "zigzag rate" is calculated in accordance with the following equation (1). EQU ZigZag.sub.-- Rate[i]=ZigZag[i].times.2-ZigZag[i-1]-ZigZag[i+1](1)
(where, i: 1 to 63)
Subsequently, product calculations in the low frequency portion and the high frequency portion of the zigzag rate are performed and the calculation results are set to (ZZ.sub.-- Rate.sub.-- moji) and (ZZ.sub.-- Rate.sub.-- HT), respectively. When a determining condition of the following equation (2) is satisfied, the block is decided to be a character image. When a determining condition of the following equation (3) is satisfied, the block is decided to be a dotted image. This discriminating method is realized by using a nature about the zigzag rate such that a value of the low frequency portion of a character image is large and a value of the high frequency portion of a dotted image is large . EQU ZZ.sub.-- Rate.sub.-- moji+Key.gtoreq.constant 1 (2) EQU ZZ.sub.-- Rate.sub.-- HT+Key.gtoreq.constant 2 (3)
Now, constants 1 and 2 are experimentally set and a value obtained by calculating a determination result of four peripheral blocks in accordance with the following equation (4) is obtained as Key. Further, "flag" in the equation (4) has a negative value if the determination result indicates the character image and has a positive value if it shows the dotted image. ##EQU1##
(2) The processes in "The DCT encoding method using the adaptive quantization" of Vol. 20, No. 5, the magazine of The Institute of Image Electrical Engineers of Japan will now be described. It is an object of this method to prevent deterioration in character image and to improve a compression ratio of a dotted image portion by separating the character image and the dotted image and switching quantization tables of the image compression (hereinafter, this method is referred to as a second prior art).
According to the above method as well, image data is first divided into blocks of a size (8.times.8) and the DCT is performed. Subsequently, the sums of the absolute values of coefficients included in areas 90 to 94 shown in FIGS. 12A to 12E are calculated, respectively. When the maximum value of the sums of the coefficients in the areas 90 to 94 is larger than 90 and the maximum value of the sums of the coefficients in the areas 91 to 94 is larger than a predetermined threshold value A, the block is determined to be a dotted image. In FIG. 12F, when the sum of the absolute values of the coefficients in the area 95 is larger than a threshold value B and the block is not decided to be a dotted image block, the block is determined to be a character image block. (3) The processes in "facsimile apparatus" disclosed in JP-A-2-202771 will now be described. It is an object of this method to clarify the separation between a binary image area and a halftone image area (hereinafter, this method is referred to as a third prior art). In an image area separation parameter determination unit in this method, image data is divided into blocks of a size (4.times.4) and a 2-dimensional Hadamard transforming process is executed. Now, assuming that Y.sub.ij is a coefficient element of an Hadamard transformation, an image area separation parameter is calculated by the following equation (5). EQU L=.SIGMA..SIGMA.yij.sup.2 (i+j=3, 4, 5, 6) (5)
A slice level for binarization is determined in accordance with a value of L. It is based on a theory "an energy in the transformation result which is assumed in a binary image area is larger than that of a high band of a space frequency". In other words, this means that in an area of a binary image, L has a large value and, in an area of a halftone image, L has a small value.
In the above prior arts, however, a cut-out ratio in the case where characters and a halftone image mixedly exist is low. The first and second prior arts are techniques for detecting a dotted image and have a problem such that they don't correspond to the cut-out from the halftone image. The third prior art has a problem such that an image area cannot be smoothly cut out in dependence on an image pattern. Particularly, in case of an image which was irreversibly compressed at least once, a coefficient of a high frequency portion (high band coefficient) has a low value. There is, consequently, a case where the square sum of the high band coefficients doesn't reach a threshold value and the image is not detected as characters. In case of including a character pattern of a bold line, since the coefficient is also distributed to low frequencies, a case where the image cannot be detected occurs.